package com.wskj.insuranceweb.reporter.mapper;

import com.wskj.insuranceweb.reporter.pojo.Accident;
import com.wskj.insuranceweb.reporter.pojo.Contract;
import com.wskj.insuranceweb.reporter.pojo.Users;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface UserMapper {

    @Select("select * from users")
    List<Users> findAll();
    @Select("select * from accident")
    List<Accident> findAccident();

    List<Users> findAllUsers(String phone, String kname);
    @Insert("insert into users values(seq_users.nextval,#{username},#{sex},#{age},#{idnumber},#{customernumber},#{clientnumber},#{userphone},#{employeename})")
    void addUser(Users user);

    Users getUser(@Param("customernumber")String customernumber,@Param("accidentdate") String accidentdate);
    @Select("select * from contract where contractid = 100001")
    Contract findContract();
}
